package com.taobao.basic.util;

import lombok.Data;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 返回json格式结果
 */
@Data
public class JsonResult {
    private Boolean success = true;
    private  String msg = "操作成功";

    // 传参使用，
    private Object resultObj;

    public static JsonResult me(){

        return new JsonResult();
    }

    public JsonResult setMsg(String msg) {
        this.success = false;
        this.msg = msg;
        return this;
    }
    // 文件上传设置一个resultObj参数赋值给msg
    public JsonResult setrRsultObj(Object msg) {
        this.resultObj = msg;
        return this;
    }


}
